class TagsController < ApplicationController
    before_action :logged_in_user, only: [:create, :destroy]
    def create
        @tag = tags.build(tag_params)
        if @tag.save
            flash[:success] = "标签创建成功"
            redirect_to root_url
        else
            flash[:fail] = "标签创建失败"
            redirect_to root_url
        end
    end
    def destroy
    end
    private
    def tag_params
        params.require(:tag).permit(:Title)
    end
end
